package vehicle_prohibit_enum

import "gitee.com/lailonghui/vehicle-supervision-framework/pkg/dicts"

// 车辆禁行-是否结束
type vehicleProhibitEndStatus int

var VehicleProhibitEndStatus vehicleProhibitEndStatus

// 未结束
func (c *vehicleProhibitEndStatus) NotOver() int {
	return 1
}

// 结束
func (c *vehicleProhibitEndStatus) Over() int {
	return 2
}

func (c *vehicleProhibitEndStatus) ToText(value int) string {
	switch value {

	case 1:
		return "未结束"

	case 2:
		return "结束"

	}
	return ""
}

func (c *vehicleProhibitEndStatus) ToDict(value int) *dicts.IntDict {
	return &dicts.IntDict{
		Text:  c.ToText(value),
		Value: value,
	}
}

func (c *vehicleProhibitEndStatus) ToValue(text string) int {
	switch text {

	case "未结束":
		return 1

	case "结束":
		return 2

	}
	return 0
}
